home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / picture / class.c < prev    next >
Text File  |  1993-09-23  |  1KB  |  35 lines

  1. //    Copyright 1993 Ralph Gonzalez
  2.  
  3. /*
  4. *   FILE:    class.c
  5. *   AUTHOR:  R.G.
  6. *   CREATED: January 20, 1992
  7. *   
  8. *   Define methods for Generic_Class
  9. */
  10.  
  11. # include "class.h"
  12.  
  13. /******************************************************************
  14. *   Generic constructor.  The constructor of each derived class
  15. *   should first check whether the parent class' constructor
  16. *   succeeded (using is_initialized()).  If so, then the constructor
  17. *   may attempt to allocate instance variables, setting "initalized"
  18. *   to FALSE if unable to do so.
  19. ******************************************************************/
  20. Generic_Class::Generic_Class(void)
  21. {
  22.     initialized = TRUE;
  23. }
  24.  
  25. /******************************************************************
  26. *   is_initialized() method returns value of "initialized" instance
  27. *   variable.  The instance variable should be set in a class'
  28. *   constructor.  No need to override.
  29. ******************************************************************/
  30. boolean Generic_Class::is_initialized(void)
  31. {
  32.     return initialized;
  33. }
  34.  
  35.